<template>
  <div class="adminHandle" >
    <h2>评教结果</h2>
    <div class="showBox">

      <div style="padding: 5px 15%">
        <h3>学生评价</h3>
        <el-table
        :data="Ast"
        style="width: 100%">
          <el-table-column
            prop="bookAvg"
            align="center"
            label="教材评分">
            <template slot-scope="scope">
              <el-rate
                v-model="scope.row.bookAvg"
                disabled
                show-score
                :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
              </el-rate></template>
          </el-table-column>
          <el-table-column
            prop="courseAvg"
            align="center"
            label="课程评分">
            <template slot-scope="scope">
              <el-rate
                v-model="scope.row.courseAvg"
                disabled
                show-score
                :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
              </el-rate></template>
          </el-table-column>
          <el-table-column
          prop="teacherAvg"
          align="center"
          label="教师评分">
            <template slot-scope="scope">
            <el-rate
              v-model="scope.row.teacherAvg"
              disabled
              show-score
              :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
            </el-rate></template>
          </el-table-column>
          <el-table-column
            prop="courseName"
            align="center"
            label="课程名称">
          </el-table-column>
      </el-table>
      </div>
    </div>
  </div>
</template>

<script>

import axios from "axios";

export default {
  name: "TeacherAst",
  data(){
    return{
      Ast:[],
    }
  },
  mounted() {
    this.ip = localStorage.getItem('ip');
    this.token = sessionStorage.getItem('token');

    axios.defaults.headers.common["token"] = this.token;
    axios.get((this.ip + '/stuComment/')).then((response)=>{
      for(let i=0;i<response.data.length;i++){
        this.Ast.push(response.data[i])
      }
    }).catch(function (error) {
      console.log(error);
    });

  }
}
</script>

<style scoped>
.adminHandle{
  width: 100%;
  padding: 5px 10px 0px 10px;
  margin: 20px 100px 0px 100px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
}
.showBox{
  padding: 10px 0px;
}
</style>
